Skip to content

TLS related fixes#38

Open
splitbrain wants to merge 2 commits into
masterfrom
tlsfixes
Open

TLS related fixes#38
splitbrain wants to merge 2 commits into
masterfrom
tlsfixes

Conversation

@splitbrain

Copy link
Copy Markdown
Collaborator

This fixes a logic error when checking the TLS settings and makes error messages in exceptions more helpful by keeping the original error. It also suppresses a warning before throwing the exception.

The protocol check in send() used a bitwise | between the last two
comparisons instead of ||. It happened to produce the correct result,
but was a typo. Use || for clarity and to avoid surprising edge cases.
- connect(): include the OS error code/message from stream_socket_client()
  so failures report 'Connection refused', 'Connection timed out', etc.
  instead of the uninformative 'Could not open SMTP Port'.
- starttls(): suppress the misleading PHP warning from
  stream_socket_enable_crypto() (often 'SSL: Success') and append the real
  OpenSSL reason from error_get_last() to the CryptoException.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant